<?php /*a:3:{s:57:"D:\phpstudy_pro\WWW\2021RBAC\app\admin\view\role\add.html";i:1614003316;s:62:"D:\phpstudy_pro\WWW\2021RBAC\app\admin\view\public\header.html";i:1614582963;s:62:"D:\phpstudy_pro\WWW\2021RBAC\app\admin\view\public\footer.html";i:1613818404;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="/static/jquery.min.js"></script>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <script src="/static/layui/layui.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">个人博客后台管理系统</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="/admin/home/index">个人主页</a></li>
<!--            <li class="layui-nav-item"><a href="">商品管理</a></li>-->
<!--            <li class="layui-nav-item"><a href="">用户</a></li>-->
<!--            <li class="layui-nav-item">-->
<!--                <a href="javascript:;">其它系统</a>-->
<!--                <dl class="layui-nav-child">-->
<!--                    <dd><a href="">邮件管理</a></dd>-->
<!--                    <dd><a href="">消息管理</a></dd>-->
<!--                    <dd><a href="">授权管理</a></dd>-->
<!--                </dl>-->
<!--            </li>-->
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    贤心
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="">退出</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->

            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <?php foreach($url as $val): ?>
                <li class="layui-nav-item layui-nav-itemed">

                    <a class="" href="javascript:;"><?php echo htmlentities($val['node_name']); ?></a>
                    <dl class="layui-nav-child">
                        <?php if(isset($val['child'])): foreach($val['child'] as $v): ?>
                            <dd><a href="<?php echo htmlentities($v['node_url']); ?>"><?php echo htmlentities($v['node_name']); ?></a></dd>
                            <?php endforeach; ?>
                        <?php endif; ?>
                    </dl>
                </li>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>角色<?php if(!(empty($role) || (($role instanceof \think\Collection || $role instanceof \think\Paginator ) && $role->isEmpty()))): ?>修改<?php else: ?>添加<?php endif; ?></legend>
</fieldset>

<form class="layui-form" action="" method="post">

    <?php if(!(empty($role) || (($role instanceof \think\Collection || $role instanceof \think\Paginator ) && $role->isEmpty()))): ?> <input type="hidden" name="id" value="<?php echo htmlentities($role['id']); ?>"> <?php endif; ?>

    <div class="layui-form-item">
        <label class="layui-form-label">角色名称</label>
        <div class="layui-input-block">
            <input type="text" name="role_name" required <?php if(!(empty($role) || (($role instanceof \think\Collection || $role instanceof \think\Paginator ) && $role->isEmpty()))): ?> value="<?php echo htmlentities($role['role_name']); ?>" <?php endif; ?> lay-verify="required" placeholder="请输入管理员账号" autocomplete="off" class="layui-input">
        </div>
    </div>

    <blockquote class="layui-elem-quote">分配权限</blockquote>

    <div class="layui-tab">
        <ul class="layui-tab-title">
            <?php foreach($list as $k=>$v): ?>
            <li <?php if($k==0): ?> class="layui-this" <?php endif; ?>><?php echo htmlentities($v['node_name']); ?></li>

            <?php endforeach; ?>
        </ul>

        <div class="layui-tab-content">
            <?php foreach($list as $k=>$v): ?>

            <div <?php if($k==0): ?> class="layui-tab-item  layui-show" <?php else: ?>class="layui-tab-item" <?php endif; ?>>
            <?php if(!(empty($v['children']) || (($v['children'] instanceof \think\Collection || $v['children'] instanceof \think\Paginator ) && $v['children']->isEmpty()))): foreach($v['children'] as $v1): ?>
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend><?php echo htmlentities($v1['node_name']); ?></legend>
            </fieldset>

                <input type="checkbox" name="node_id[]"  value="<?php echo htmlentities($v['id']); ?>/<?php echo htmlentities($v1['id']); ?>" <?php if(!(empty($r_n) || (($r_n instanceof \think\Collection || $r_n instanceof \think\Paginator ) && $r_n->isEmpty()))): if(in_array($v1['id'],$r_n)): ?>checked <?php endif; ?><?php endif; ?> title="<?php echo htmlentities($v1['node_name']); ?>">
                <br><br>
            <fieldset class="layui-elem-field">
                <legend><?php echo htmlentities($v1['node_name']); ?>子节点</legend>
                <?php if(!(empty($v1['children']) || (($v1['children'] instanceof \think\Collection || $v1['children'] instanceof \think\Paginator ) && $v1['children']->isEmpty()))): foreach($v1['children'] as $v2): ?>
                        <div class="layui-field-box">
                            <input type="checkbox"  name="node_id[]" value="<?php echo htmlentities($v['id']); ?>/<?php echo htmlentities($v1['id']); ?>/<?php echo htmlentities($v2['id']); ?>"  <?php if(!(empty($r_n) || (($r_n instanceof \think\Collection || $r_n instanceof \think\Paginator ) && $r_n->isEmpty()))): if(in_array($v2['id'],$r_n)): ?>checked <?php endif; ?><?php endif; ?> title="<?php echo htmlentities($v2['node_name']); ?>">
                        </div>
                    <?php endforeach; else: ?>
                <br>
                <legend>子节点为空</legend>
                <br>
                <?php endif; ?>
            </fieldset>
            <hr class="layui-bg-red">
                <?php endforeach; else: ?>
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <br>
            <legend style="font-size: 24px">子节点为空</legend>
            <br>
            </fieldset>
            <?php endif; ?>
            </div>
        <?php endforeach; ?>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>



<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){

        });
    });
</script>

</div>
</div>

<div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
</div>
</div>

<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;

    });
</script>
</body>
</html>